package org.rambadger.command.event;

import org.rambadger.command.validation.UrlIdentifier;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

public class SubmissionClaimedForReview implements Serializable {
    private static final long serialVersionUID = -7336024144986131173L;

    //Compound Key {
    private final String submitterId;
    private final int submissionId;
    //}
    private final String reviewerId;

    public SubmissionClaimedForReview(String submitterId, int submissionId, String reviewerId) {
        this.submitterId = submitterId;
        this.submissionId = submissionId;
        this.reviewerId = reviewerId;
    }

    @UrlIdentifier @NotNull
    public String getSubmitterId() {
        return submitterId;
    }

    @Min(1)
    public int getSubmissionId() {
        return submissionId;
    }

    @UrlIdentifier @NotNull
    public String getReviewerId() {
        return reviewerId;
    }

    public String getFullSubmissionId() {
        return submitterId+"/"+submissionId;
    }

    @Override
    public String toString() {
        return "SubmissionClaimedForReview{" +
                "submitterId='" + submitterId + '\'' +
                ", submissionId=" + submissionId +
                ", reviewerId='" + reviewerId + '\'' +
                '}';
    }
}
